package com.lihuinch.ti4j.chap6.demo2;

import com.lihuinch.ti4j.chap6.demo.FatherClass;

/**
 * 不同包下继承的父类
 *
 * @author lihuinch
 * @date 2018/1/22
 */
public class DiffPacSonClass extends FatherClass {

    void defaultFun() {
        System.out.println("DiffPacSonClass defaultFun");
    }

    protected void protectedFun() {
        System.out.println("DiffPacSonClass protectedFun");
    }

    // 默认重写 @Override
    public void publicFun() {
        System.out.println("DiffPacSonClass publicFun");
    }

    public static void main(String[] args) {
        FatherClass pointToDiff = new DiffPacSonClass();
        //FatherClass pointToSame = new SamePacSonClass();

        // 不可调用 pointToDiff.defaultFun();
        pointToDiff.publicFun();
        // 不可调用 pointToDiff.protectedFun();

//        pointToSame.defaultFun();
//        pointToSame.publicFun();

    }
}
